class GameData {

    public static unmapnum: number = 0;			// 不可用的地图块数量
    public static mapData: number[][];			// 地图块数据，存放element编号
    public static stepNum: number = 0;			// 关卡剩余步数
    public static levelStepNum: number = 0;		// 关卡总步数
    public static elementTypes: number[];		// 观其包含的元素类型
    public static levelreq: LevelRequire;		// 过关条件
    public static elements: GameElement[];		// 游戏元素
    public static unusedElements: number[];		// 未使用的元素
    public static levelBackgroungImageName: string = "";	// 关卡背景图

    public static MaxRow: number = 8;				// 地图行数
    public static MaxColumn: number = 8;			// 地图列数
    public static currentElementNum: number = 0;	// 当前可用元素数量

    public static stageW: number = 0;
    public static stageH: number = 0;

    public static initData() {

        GameData.mapData = [];
        for (let i = 0; i < GameData.MaxRow; i++) {
            let arr: number[] = [];
            for (let j = 0; j < GameData.MaxColumn; j++) {
                GameData.mapData[i].push(-2); // -1 无法使用，-2未放置元素
            }
        }

        GameData.levelreq = new LevelRequire();

        GameData.elements = [];
        GameData.unusedElements = [];
        let len: number = GameData.MaxRow * GameData.MaxColumn;
        for (let m = 0; m < len; m++) {
            let ele: GameElement = new GameElement();
            ele.id = m;
            GameData.elements.push(ele);
            GameData.unusedElements.push(m);
        }

        GameData.stageW = egret.MainContext.instance.stage.stageWidth;
        GameData.stageH = egret.MainContext.instance.stage.stageHeight;
    }
}